//
//  YBCodeCell.m
//  Cocoachina
//
//  Created by 游兵 on 2017/9/15.
//  Copyright © 2017年 YBing. All rights reserved.
//

#import "YBCodeCell.h"
#import <UIImageView+WebCache.h>
#import "NSUserDefaults+Extension.h"
#import "NSString+MD5Addition.h"

@implementation YBCodeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.borderView.layer.borderColor = [UIColor grayColor].CGColor;
    self.borderView.layer.borderWidth = 1;
    self.timeLabel.adjustsFontSizeToFitWidth = YES;
}

- (void)setCode:(YBCode *)code
{
    _code = code;
    
    self.imgViewH.constant = code.imgH;
    
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:code.img]];
    
    self.titleLabel.text = code.title;
    self.descLabel.text = code.desc;
    self.descH.constant = code.descH;
    
    
    self.timeLabel.text = code.time;
    [self.downloadLabel setIconText:[NSString stringWithFormat:@"%@%@", @"\U0000e61d", code.download] fontSize:14];
    
    
}

@end
